#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDialog>
#include "data.h"
#include "ui_mainwindow.h"


typedef enum {
  ViewState_UNCHANGED, ViewState_CHANGED, ViewState_NEW_UNCHANGED, ViewState_NEW_CHANGED
} ViewState;

class MainWin : public QMainWindow, public Ui::MainWindow
{
    Q_OBJECT
public:
  MainWin(QWidget *parent=0);
  ~MainWin();
  void save();
private:
  ViewState view_state;
  BiblioDb *db;
  void change();
  void clear();
  void load_data(biblio::Paper*);
private slots:
  void on_button_left_clicked();
  void on_button_right_clicked();
  void on_button_save_clicked();
  void on_button_open_clicked();
  void on_button_new_clicked();
  void on_button_view_clicked();
  void on_line_author_textEdited();
  void on_line_title_textEdited();
  void on_text_annote_textChanged();
  void on_button_add_author_clicked();
};


#endif